Optimal. Leaf size=177 \[ \frac {a^4 (64 B+67 i A) \cot (c+d x)}{12 d}+\frac {8 a^4 (A-i B) \log (\sin (c+d x))}{d}+\frac {(19 A-16 i B) \cot ^2(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{12 d}+8 a^4 x (B+i A)-\frac {(4 B+7 i A) \cot ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}-\frac {a A \cot ^4(c+d x) (a+i a \tan (c+d x))^3}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.53, antiderivative size = 177, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3593, 3591, 3531, 3475} \[ \frac {a^4 (64 B+67 i A) \cot (c+d x)}{12 d}+\frac {8 a^4 (A-i B) \log (\sin (c+d x))}{d}-\frac {(4 B+7 i A) \cot ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {(19 A-16 i B) \cot ^2(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{12 d}+8 a^4 x (B+i A)-\frac {a A \cot ^4(c+d x) (a+i a \tan (c+d x))^3}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3531
Rule 3591
Rule 3593
Rubi steps
\begin {align*} \int \cot ^5(c+d x) (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx &=-\frac {a A \cot ^4(c+d x) (a+i a \tan (c+d x))^3}{4 d}+\frac {1}{4} \int \cot ^4(c+d x) (a+i a \tan (c+d x))^3 (a (7 i A+4 B)-a (A-4 i B) \tan (c+d x)) \, dx\\ &=-\frac {a A \cot ^4(c+d x) (a+i a \tan (c+d x))^3}{4 d}-\frac {(7 i A+4 B) \cot ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {1}{12} \int \cot ^3(c+d x) (a+i a \tan (c+d x))^2 \left (-2 a^2 (19 A-16 i B)-2 a^2 (5 i A+8 B) \tan (c+d x)\right ) \, dx\\ &=-\frac {a A \cot ^4(c+d x) (a+i a \tan (c+d x))^3}{4 d}-\frac {(7 i A+4 B) \cot ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {(19 A-16 i B) \cot ^2(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{12 d}+\frac {1}{24} \int \cot ^2(c+d x) (a+i a \tan (c+d x)) \left (-2 a^3 (67 i A+64 B)+2 a^3 (29 A-32 i B) \tan (c+d x)\right ) \, dx\\ &=\frac {a^4 (67 i A+64 B) \cot (c+d x)}{12 d}-\frac {a A \cot ^4(c+d x) (a+i a \tan (c+d x))^3}{4 d}-\frac {(7 i A+4 B) \cot ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {(19 A-16 i B) \cot ^2(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{12 d}+\frac {1}{24} \int \cot (c+d x) \left (192 a^4 (A-i B)+192 a^4 (i A+B) \tan (c+d x)\right ) \, dx\\ &=8 a^4 (i A+B) x+\frac {a^4 (67 i A+64 B) \cot (c+d x)}{12 d}-\frac {a A \cot ^4(c+d x) (a+i a \tan (c+d x))^3}{4 d}-\frac {(7 i A+4 B) \cot ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {(19 A-16 i B) \cot ^2(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{12 d}+\left (8 a^4 (A-i B)\right ) \int \cot (c+d x) \, dx\\ &=8 a^4 (i A+B) x+\frac {a^4 (67 i A+64 B) \cot (c+d x)}{12 d}+\frac {8 a^4 (A-i B) \log (\sin (c+d x))}{d}-\frac {a A \cot ^4(c+d x) (a+i a \tan (c+d x))^3}{4 d}-\frac {(7 i A+4 B) \cot ^3(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {(19 A-16 i B) \cot ^2(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{12 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 6.36, size = 319, normalized size = 1.80 \[ \frac {a^4 \sin (c+d x) (\cot (c+d x)+i)^4 (A \cot (c+d x)+B) \left (192 d x (A-i B) (\sin (4 c)+i \cos (4 c)) \sin ^4(c+d x)+48 (A-i B) (\cos (4 c)-i \sin (4 c)) \sin ^4(c+d x) \log \left (\sin ^2(c+d x)\right )-96 i (A-i B) (\cos (4 c)-i \sin (4 c)) \sin ^4(c+d x) \tan ^{-1}(\tan (5 c+d x))+4 (\cos (4 c)-i \sin (4 c)) ((-B-4 i A) \cot (c)+12 A-6 i B) \sin ^2(c+d x)-8 i (14 A-11 i B) \csc (c) (\cos (4 c)-i \sin (4 c)) \sin (d x) \sin ^3(c+d x)+4 (B+4 i A) \csc (c) (\cos (4 c)-i \sin (4 c)) \sin (d x) \sin (c+d x)+3 i A \sin (4 c)-3 A \cos (4 c)\right )}{12 d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.57, size = 228, normalized size = 1.29 \[ -\frac {4 \, {\left (6 \, {\left (5 \, A - 3 i \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} - 9 \, {\left (7 \, A - 5 i \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (25 \, A - 19 i \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} - {\left (14 \, A - 11 i \, B\right )} a^{4} - 6 \, {\left ({\left (A - i \, B\right )} a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} - 4 \, {\left (A - i \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, {\left (A - i \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} - 4 \, {\left (A - i \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (A - i \, B\right )} a^{4}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )\right )}}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} - 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} - 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 7.28, size = 322, normalized size = 1.82 \[ -\frac {3 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 32 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 180 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 96 i \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 864 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 696 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3072 \, {\left (A a^{4} - i \, B a^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) - 1536 \, {\left (A a^{4} - i \, B a^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) + \frac {3200 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 3200 i \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 864 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 696 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 180 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 96 i \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 32 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 8 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, A a^{4}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.45, size = 189, normalized size = 1.07 \[ \frac {7 A \,a^{4} \left (\cot ^{2}\left (d x +c \right )\right )}{2 d}+\frac {8 a^{4} B c}{d}+\frac {7 B \cot \left (d x +c \right ) a^{4}}{d}+8 i A x \,a^{4}+8 a^{4} B x +\frac {8 i A \cot \left (d x +c \right ) a^{4}}{d}+\frac {8 i A \,a^{4} c}{d}-\frac {8 i B \,a^{4} \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {4 i A \,a^{4} \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}-\frac {2 i B \,a^{4} \left (\cot ^{2}\left (d x +c \right )\right )}{d}-\frac {A \,a^{4} \left (\cot ^{4}\left (d x +c \right )\right )}{4 d}-\frac {a^{4} B \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}+\frac {8 a^{4} A \ln \left (\sin \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.75, size = 134, normalized size = 0.76 \[ \frac {12 \, {\left (d x + c\right )} {\left (8 i \, A + 8 \, B\right )} a^{4} - 48 \, {\left (A - i \, B\right )} a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 96 \, {\left (A - i \, B\right )} a^{4} \log \left (\tan \left (d x + c\right )\right ) - \frac {{\left (-96 i \, A - 84 \, B\right )} a^{4} \tan \left (d x + c\right )^{3} - 6 \, {\left (7 \, A - 4 i \, B\right )} a^{4} \tan \left (d x + c\right )^{2} + {\left (16 i \, A + 4 \, B\right )} a^{4} \tan \left (d x + c\right ) + 3 \, A a^{4}}{\tan \left (d x + c\right )^{4}}}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.57, size = 114, normalized size = 0.64 \[ \frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {7\,A\,a^4}{2}-B\,a^4\,2{}\mathrm {i}\right )+{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (7\,B\,a^4+A\,a^4\,8{}\mathrm {i}\right )-\frac {A\,a^4}{4}-\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {B\,a^4}{3}+\frac {A\,a^4\,4{}\mathrm {i}}{3}\right )}{d\,{\mathrm {tan}\left (c+d\,x\right )}^4}+\frac {16\,a^4\,\mathrm {atan}\left (2\,\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B+A\,1{}\mathrm {i}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.96, size = 235, normalized size = 1.33 \[ \frac {8 a^{4} \left (A - i B\right ) \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} + \frac {- 56 A a^{4} + 44 i B a^{4} + \left (200 A a^{4} e^{2 i c} - 152 i B a^{4} e^{2 i c}\right ) e^{2 i d x} + \left (- 252 A a^{4} e^{4 i c} + 180 i B a^{4} e^{4 i c}\right ) e^{4 i d x} + \left (120 A a^{4} e^{6 i c} - 72 i B a^{4} e^{6 i c}\right ) e^{6 i d x}}{- 3 d e^{8 i c} e^{8 i d x} + 12 d e^{6 i c} e^{6 i d x} - 18 d e^{4 i c} e^{4 i d x} + 12 d e^{2 i c} e^{2 i d x} - 3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________